import java.util.Scanner;

public class Question01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //0->0
        //1->0+1
        //2->0+1+2
        //3->0+1+2+3
        //输入几就0+...+几
        System.out.println("请输入一个数字");
        int num = scanner.nextInt();
        int b = 0;
        for (int i = 0; i <= num; i++) {
            b = i + b;
        }
        System.out.println("这个数字的和为:" + b);
    }
}
